    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
    <script>
   setInterval(function(){console.log("11")},500);

        setInterval(autoPlay,1000);
        var p=0;
        function autoPlay() {
            p++;

            //索引值不能大于4，大于4必须变为0
            if(p>4){
                p=0;
            }
            console.log(p);

        };

    </script>

    </body>
    </html>